% -------------------------------------------------------------------------
% plot Earth and Moon under Earth-Centered-Inertial frame
%
% Copyright(C) 2015/06/30 by Chen Zhang, 
% School of Astronautics, Beihang University
% chenzhang.buaa@gmail.com
% -------------------------------------------------------------------------
function em_ini
l_ref = 384405; % Earth Moon Distance / Length unit [km]
Re = 6378; % Earth radius [km]
hi = 167; % orbit altitude of parking orbit [km]
ri = (Re + hi) / l_ref; % radial distance of parking orbit [ - ]
% plot Earth
[xs ys zs] = sphere(10);
surf(xs*Re/l_ref,  ys*Re/l_ref, zs*Re/l_ref, 'FaceColor', 'w'); hold on;
% plot parking orbit
angle = 0 : 0.05 : 2*pi + 0.05;
plot(ri*cos(angle), ri*sin(angle), 'k-.'); hold on;
% plot Moon orbit
angle = 0 : 0.1 : 2*pi + 0.05;
plot(cos(angle), sin(angle), 'k-.'); hold on;
axis equal;
end
% -------------------------------------------------------------------------
